Part Number Hot Search : 
LTC34 C2673 74122 1AM28 NL17S UN6218 S29GL256 MN6500JS
Product Description
Full Text Search
 

To Download DS1961S-F3 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  1 of 36 092302 ds1961s 1kb protected eeprom ibutton with sha-1 engine www.maxim-ic.com special features  1128 bits of 5v eeprom memory partitioned into four pages of 256 bits, a 64- bit write-only secret, and up to five general-purpose read/write registers  write access requires knowledge of the secret and the capability of computing and transmitting a 160-bit mac (message authentication code) as authorization  secret and data memory can be write- protected (all or page 0 only) or put in eprom-emulation mode (?write to 0?, page 1)  on-chip, 512-bit sha-1 engine to compute 160-bit macs and generate secrets  reads and writes over a wide 2.8v to 5.25v voltage range from -40c to +85c  communicates to host with a single digital signal at 14.1kbps using 1-wire ? protocol  on-chip, 16-bit cyclic redundancy check (crc) generator for safeguarding data transfers  overdrive mode boosts communication speed to 125kbps  operating temperature range from -40c to +85c  minimum 10 years of data retention at +85c common ibutton features  unique, factory-lasered and tested 64-bit registration number (8-bit family code + 48-bit serial number + 8-bit crc tester) assures absolute traceability because no two parts are alike  multidrop controller for 1-wire net  digital identification and information by momentary contact  chip-based data carrier compactly stores information  data can be accessed while affixed to object  button shape is self-aligning with cup- shaped probes  durable stainless-steel case engraved with registration number withstands harsh environments  easily affixed with self-stick adhesive backing, latched by its flange, or locked with a ring pressed onto its rim  presence detector acknowledges when reader first applies voltage  meets ul#913 (4th edit.). intrinsically safe apparatus: approved under entity concept for use in class i, division 1, groups a, b, c, and d locations (application pending) f5 microcan io gnd 0.36 0.51 5.89 ? 1993 yyww registered rr xx 33 000000fbd8b3 16.25 17.35 f3 microcan io gnd 0.36 ? 1993 yyww registered rr xx 33 000000fbc52b 16.25 17.35 0.51 3.10 all dimensions are shown in millimeters. ibutton, 1-wire, and microcan are registered trademarks of dallas semiconductor.
ds1961s 2 of 36 ordering information ds1961s-f5 f5 ibutton DS1961S-F3 f3 ibutton examples of accessories ds1963s sha coprocessor and button ds9096p self-stick adhesive pad ds9101 multipurpose clip ds9093ra mounting lock ring ds9093a snap-in fob ds9092 ibutton probe ibutton description the ds1961s combines 1024 bits of eeprom, a 64-bit s ecret, an 8-byte register/control page with up to five user-read/write bytes, a 512-bit sha-1 engine, and a fully featured 1-wire interface in a rugged ibutton. data is transferred serially through the 1- wire protocol, which require s only a single data lead and a ground return. the ds1961s has an additional memory area called th e scratchpad that acts as a buffer when writing to the main memory, the register page, or when installing a new secret. data is first written to the scratchpad from where it can be read back. after the data has been verified, a copy scratchpad command transfers the da ta to its final memory location, provided that the ds1961s receives a matching 160-bit mac. the computation of the mac involves the secret and a dditional data stored in the ds1961s including the device?s identity register. only a new secret can be loaded without providing a mac. the sha-1 engine can also be activated to compute 160-bit macs when reading a memory page or to compute a new secret, instead of loading it. the ds1961s understands a unique command "refresh sc ratchpad." proper use of a refresh sequence after a copy scratchpad operation reduces the number of weak bit failures in a touch environment (see the writing with verification section). the refresh sequence also pr ovides a means to restore functionality in a device with bits in a weak state. each ds1961s has its own 64-bit rom registration num ber that is factory lasered into the chip to provide a guaranteed unique identity for absolute traceability. the durable stainless-steel package is highly resistant to environmental hazards such as dirt, moisture, and shock. its compact coin-shaped profile is self-aligning with mating receptacles, allowing the ds1961s to be easily used by human operators. accessories permit the ds1961s to be m ounted on almost any surface including plastic key fobs and photo-id badges. applications the ds1961s can be used for different purposes such as secure access control, user/product authentica- tion, after-market management of c onsumables, and as monetary toke ns in electronic payment systems. as carrier of electronic cash (ecash ), the ds1961s can store up to three monetary files or "purses" of a single service provider, which make the device well suited for company-sized single-secret applications such as cafeteria, copy machines, and access control at entertainment parks or private clubs. for increased security or if the processing power of the host mic rocontroller is insufficient, a ds1963s can be used as secure coprocessor to verify macs generated by the ds1961s or to compute macs needed for writing to the ds1961s. overview the block diagram in figure 1 shows the relationships between the major control and memory sections of the ds1961s. the ds1961s has five main data components: 1) 64-bit la sered rom, 2) 64-bit scratchpad, 3) four 32-byte pages of eeprom, 4) 64-bit register page, 5) 64-b it secrets memory, and 6) a 512-bit
ds1961s 3 of 36 sha-1 (secure hash algorithm) engine. the hierarchi cal structure of the 1-wire protocol is shown in figure 2. the bus master must first provide one of the seven rom function co mmands, 1) read rom, 2) match rom, 3) search rom, 4) skip rom, 5) resume communicati on, 6) overdrive-skip rom, or 7) overdrive-match rom. upon comple tion of an overdrive rom command byte executed at standard speed, the device enters overdrive mode where all subsequent communication occurs at a higher speed. the protocol required for these rom function commands is described in figur e 9. after a rom function command is successfully executed, the memory functions become accessible and the master can provide any one of the eight memory and sha function co mmands. the protocol for these memory and sha function commands is described in figure 7. all data is read and written lsb first. figure 1. ds1961s block diagram parasite power 1-wire net 64-bit lasered rom 1-wire function control secrets memory 64-bit 64-bit scratchpad data memory 4 pages of 256 bits each crc16 generator memory and sha function control unit 512-bit secure hash algorithm engine register page 64-bit 64-bit lasered rom each ds1961s contains a unique rom co de that is 64 bits long. the first eight bits are a 1-wire family code. the next 48 bits are a unique serial number. the last eight bits are a crc of the first 56 bits (see figure 3). the 1-wire crc is generated using a polynomial generator consisting of a shift register and xor gates as shown in figure 4. the polynomial is x 8 + x 5 + x 4 + 1. additional information about the dallas 1-wire crc is available in the book of ds19xx ibutton standards from dallas semiconductor. the shift register bits are initialized to zero. then starting with the lsb of the family code, one bit at a time is shifted in. after the 8th bit of the family code has been entered, then the serial number is entered. after the 48th bit of the serial number has been entered, the shift register contains the crc value. shifting in the eight bits of crc should re turn the shift register to all zeros.
ds1961s 4 of 36 figure 2. hierarchical structure for 1-wire protocol 1-wire net other devices bus master ds1961s a vailable commands: command level: data field a ffected: 1-wire rom function commands (see figure 9) ds1961s-specific memory function commands (see figure 7) read rom match rom search rom skip rom resume overdrive skip overdrive match 64-bit reg. #, rc-flag 64-bit reg. #, rc-flag 64-bit reg. #, rc-flag rc-flag rc-flag 64-bit reg. #, rc-flag, od-flag 64-bit reg. #, rc-flag, od-flag write scratchpad read scratchpad load first secret compute next secret copy scratchpad read authenti- cated page read memory refresh scratchpad 64-bit scratchpad, flags 64-bit scratchpad secret, flags; data memory (after refresh scratchpad) secret, data memory, scratchpad data memory or register page, secret, flags, 64-bit reg. #, data memory, secret, 64-bit reg. #, 3-byte challenge in scratchpad data memory, register page, reg. # 64-bit scratchpad, data memory, flags figure 3. 64-bit lasered rom msb lsb 8-bit crc code 48-bit serial number 8-bit family code (33h) msb lsb msb lsb msb lsb
ds1961s 5 of 36 figure 4. 1-wire crc generator x 0 x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 pol y nomial = x 8 + x 5 + x 4 + 1 1st stage 2nd stage 3rd stage 4th stage 6th stage 5th stage 7th stage 8th stage input data memory map the ds1961s has four memory areas: data memory, secrets memory, regi ster page with special function registers and user-bytes, and a scratchpad. the data memory is organized in pages of 32 bytes. secret, register page, and scratchpad are 8 bytes each. the scratchpad acts as a buffer when writing to the data memory, loading the initial secret or when writing to the register page. data memory, secrets memory, and the register page are located in a linear address space, as shown in figure 5. the data memory and the register page have unrestricted read access. writing to the data memory and the register page requires knowledge of the secret. figure 5. ds1961s memory map address range description note 0000h to 001fh data memory page 0 no write-access without secret 0020h to 003fh data memory page 1 no write-access without secret 0040h to 005fh data memory page 2 no write-access without secret 0060h to 007fh data memory page 3 no write-access without secret 0080h to 0087h secrets memory no read access; no secret needed for write access 0088h 1) write-protect secret, 008ch to 008fh protection activated by code aah or 55h 0089h 1) write-protect pages 0 to 3 protection activated by code aah or 55h 008ah 1) user byte, self-protecting protection activated by code aah or 55h 008bh factory byte (read only) reads either aah or 55h; see text 008ch 1) user byte/eprom mode control for page 1 mode activated by code aah or 55h 008dh 1) user byte/write-protect page 0 only protection activated by code aah or 55h 008eh to 008fh user bytes/manufacturer id function depends on factory byte 0090h to 0097h 64-bit identity register read-only access 1) once programmed to aah or 55h this address become s read-only. all other codes can be stored but will neither write-protect the address nor activate any function.
ds1961s 6 of 36 the secret can be installed either by copying data from the scratchpad to the secrets memory or by computation using the current secret and the scratchpa d contents as partial secret. the secret cannot be read directly; only the sha engine has access to it for computing message authentication codes. the address range 0088h to 008fh, also referred to as the register page, contains special function registers as well as general-purpose user-bytes a nd one factory byte. once programmed to aah or 55h, most of these bytes become write-protected and can no longer be altered. all other codes neither write- protect the address nor activate the special function associated to that particular byte. special functions are: 1) write-protecting only the secret, 2) write-protecting all four data memory pages simultaneously, 3) activating eprom mode for data memory page 1 only, and 4) write-protecting data memory page 0 only. once eprom mode is activated, bits in the addre ss range 0020h through 003fh can only be altered from a logic 1 to a logic 0, provided that th e data memory is not write protected. the factory byte either reads 55h or aah. typically, this address reads 55h, indicating that the addresses 008e and 008f are read/write user-bytes without any special function or locking mechanism. the code of aah indicates that these two bytes are programmed with a 16-bit manufacturer id and then write- protected at the factory. the manufacturer id can be a customer-supplied identification code that assists the application software in identifying the product the ds1961s is associated with and in faster selection of the applicable secret. to setup and register a manufacturer id contact the factory. the address range 0090h to 0097h is called the identity regi ster. typically, the identity register contains a copy of the device?s rom registration number. the fa mily code is stored at the lower address followed by the 48-bit serial number and the 8-bit crc, which is stored at address 0097h. in reading through these addresses (0090h to 0097h) the bus ma ster receives the individual b its of the registration number in exactly the same sequence as with a rom function command. with customized versions, the content of the identity register can be any customer-speci fied constant pattern. for more information on customization contact the factory. figure 6. address registers bit number76543210 target address (ta1) t7 t6 t5 t4 t3 t2 (0) t1 (0) t0 (0) target address (ta2) t15 t14 t13 t12 t11 t10 t9 t8 ending address with data status (e/s) (read only) aa 1 pf 1 1 e2 (1) e1 (1) e0 (1) address registers and transfer status the ds1961s employs three address registers: ta1, ta2, and e/s (figure 6). these registers are common to many other 1-wire devices but operate s lightly differently with the ds1961s. registers ta1 and ta2 must be loaded with the target address to which the data is written or from which data is read. register e/s is a read-only transfer-status register, used to verify data integrity with write commands. since the scratchpad of the ds1961s is designed to a ccept data in blocks of eight bytes only, the lower three bits of ta1 are forced to 0 and the lower three bits of the e/s register (ending offset) always read 1.
ds1961s 7 of 36 this indicates that all the data in the scratchpad is used for a subsequent copying into main memory or secret. bit 5 of the e/s register, called pf or partial byte flag, is a logic-1 if the number of data bits sent by the master is not an integer multiple of eight or if the data in the scratchpad is not valid due to a loss of power. a valid write to the scratchpad clears the pf bit. bits 3, 4, and 6 have no function; they always read 1. the partial flag supports the master check ing the data integrity after a write command. the highest valued bit of the e/s register is called the aa or authorization accepted flag, which indicates that the data stored in the scratchpad has already been copied to the target memory address. writing data to the scratchpad clears this flag. writing with verification to write data to the ds1961s, the sc ratchpad has to be used as interm ediate storage. first the master issues the write scratchpad command, wh ich specifies the desired target a ddress and the data to be written to the scratchpad. note th at writes to data memory must be perfo rmed on 8-byte boundaries with the three lsbs of the target address t2?t0 equal to 000b. theref ore, if t2?t0 are sent with non-zero values, the device sets these bits to zero and uses the modified address as the target address. the master should always send eight complete data bytes. after the eight bytes of data have been transmitted, the master can elect to receive an inve rted crc16 of the write scratchpad command, the address as sent by the master, and the data as sent by the master. the master can compare the crc to the value it has calculated itself in order to determine if the communication was successful. after the scratchpad has been written, the master should always perform a read scratchpad to verify th at the intended data was in fact written. during a read scratchpad, the ds1961s repeats the target addr ess ta1 and ta2 and sends the contents of the e/s register. the partial flag (bit 5 of the e/s register) is set to 1 if the last data byte the ds1961s received during a write scratchpad or refr esh scratchpad command was incomplete , or if there was a loss of power since data was last written to the scratchpad. the authorization-accepted (aa) flag (bit 7 of the e/s register) is normally cleared by a write scratchpad or refresh scratchpad; therefore, if it is set to 1, it indicates that the ds1961s did not understand the proceeding write (o r refresh) scratchpad command. in either of these cases, the master should rewrite the sc ratchpad. after the master receives the e/s register, the scratchpad data is received. the descriptions of write scratchpad and refresh scratchpad provide clarification of what changes can occur to the sc ratchpad data under certain conditions. an inverted crc of the read scratchpad command, target address, e/s register, and scra tchpad data follows the scratchpad data. as with the write scratchpad command, this crc can be compared to the value the master has calculated itself in order to determine if the communication was successful. after the master has verified the data, it can send the copy scratchpad to copy the scratchpad to memory. alternatively, the load first secret or compute next secret command can be issued to change the secret. see the descriptions of these commands for more information. in a touch environment the quality of the electr ical contact cannot be guaranteed. with poor or intermittent contact it is possible for a copy scratchpad command to complete with insufficient energy, leaving the floating gate voltage of an eeprom bit in the area of the threshold between 0 and 1. when this occurs, the logical value of the bit is not assured. depending on voltage and/or temperature conditions, the same bit can be read by the host as on e polarity and then by the internal sha-1 engine as the opposite polarity. this becomes a fatal lockup mode because the host cannot formulate a proper sha- 1 mac to enable the bit to be rewritten. to repair poorly written bits and thereby restore the device to functionality, the refresh scratchpad command was introduced. combined with the load first secret command, refresh scratchpad provides a means to re store the eeprom bits to normal values, removing lockup conditions and allowing the device to be written again. to prevent the occurrence of poorly written bits, a refresh sequence should be performed after each copy scratchpad command. a refresh sequence is defined as a refresh scratchpad (to the same target address as the previous copy scratchpad), followed by a load fi rst secret. the en_lfs flag is set by the refresh
ds1961s 8 of 36 scratchpad command. the en_lfs flag enables the use of load first secret to addresses 0000h?007fh. using load first secret allows the master to copy the scratchpad to memory w ithout the mac computation necessary during a copy scratchpad. if the master attempts any command after refresh scratchpad that could change the scratchpad data or th e target address, en_lfs is reset to 0. this prevents the use of load first secret to load any data other than the refreshed memory data to any location other than the one specified during refresh scratchpad. refresh scratchp ad behaves exactly as write scratchpad does for target addresses 0080h and above . in this case the en_lfs flag is not set, so it is not possible to refresh the data in the secret (0080h) or in the register page (0088h). this prevents the secret from being revealed by a refresh scratchpad followed by a read scratchpad. memory and sha function commands due to its design as a secure devi ce, the ds1961s has to behave differ ently from other memory ibuttons. although most of the memory of the ds1961s can be read the same way as any other memory ibutton, attempts to read the secret results in ffh-bytes rather than real data. the memory and sha function flow chart (figure 7) describes the protocols necessary for accessing the memory and operating the sha engine. the communication between master and ds1961s takes place either at regular speed (default, od = 0) or at overdrive speed (od = 1). if not ex plicitly set into overdrive mode the ds1961s assumes regular speed. write scratchpad [0fh] the write scratchpad command applies to the data memory, the secret and the writeable addresses in the register page. if the bus master sends a target address higher than 90h, the command is not executed. after issuing the write scratchpad command, the master must first pr ovide the 2-byte target address, followed by the data to be written to the scratchpad. the data is written to the scratchpad starting at the beginning of the scratchpad. note that the ending o ffset (e2..e0, see figure 6) is always 111b regardless of the number of bytes that the master has trans mitted. for this reason the master should always send eight bytes, especially if the data is to be loaded as a secret. if the master sends less than eight data bytes and does not read back the scratchpad for verification, parts of the new secret can be random data that is unknown to the master. only full data bytes are accepted. if the last data byte is incomplete its content is ignored and the partial byte flag (pf) is set. when executing the write scratchpad command the crc generator inside the ds1961s (see figure 12) calculates a crc of the entire data stream, starting at the command code and ending at the last data byte as sent by the master. this crc is generated using the crc16 polynomial by first clearing the crc generator and then shifting in the command code (0fh) of the write scratchpad command, the target addresses (ta1 and ta2), and all the data bytes. note that the crc16 calculation is performed with the actual ta1 sent by the master even though the ds 1961s sets ta1 bits t2..t0 to 000b for the actual write scratchpad command. the master can end the write scratchpad command at any time. however, if the scratchpad is filled to its capacity, the master can send 16 read-time slots and receives the crc generated by the ds1961s. if the master continues reading after the crc all data is be ffh. after receiving the target addresses (ta1 and ta 2), the ds1961s clears the en_lfs flag. if eprom mode is active and a write scratc hpad is attempted within page 1 (0020h?003fh), the scratchpad is loaded with the logical and of the scratchpad data sent by the master and the current content of the target memory location. if a write scratc hpad is attempted to the register page (0088h?008fh), any bytes that are write-protected overwrite the corresponding scratchpa d data byte sent by the master with the existing value. in all other cases, the data sent by the master is written to the scratchpad unaltered.
ds1961s 9 of 36 read scratchpad [aah] the read scratchpad command allows verifying the target address and the integrity of the scratchpad data. after issuing the command code, the master begins reading. the first two bytes is the target address with t2 to t0 = 0. the next byte is the ending offset/data status byte (e/s) followed by the scratchpad data, which may be different from what the master has originally sent. this is of particular importance if the target address is the secret, the register page, page 1 (in eprom mode), or if refresh was used to load the scratchpad. in these cases, the scratchpad can contain data other than that which was sent during either the write scratchpad or refresh sc ratchpad commands. the master should read through the end of the scratchpad after which it receives the inverted crc that is computed with the data as sent by the ds1961s. if the master continues reading after the crc all data is ffh. the scratchpad can be loaded using the write scra tchpad or refresh scratc hpad command. the data found in the scratchpad depends on the command used, the target address, and whether or not eprom mode is active. see the descriptions of write scratc hpad and refresh scratc hpad for clarification. load first secret [5ah] the load first secret command has two modes of ope ration, which are controlled by the en_lfs flag. with en_lfs = 0, the command replaces the device?s current secret with the contents of the scratchpad, provided that the secret is not write-protected. with en_lfs = 1, the command allows to rewrite memory data (addresses 0000h to 007fh), bypassing th e sha-1 computation that is required when doing the same through the copy scratchpad command. the en _lfs flag is 0 unless it has been set to 1 by executing the refresh scratchpad command prior to load first secret. case en_lfs = 0 before the load first secret command can be used in this mode, the master must have written the new secret to the scratchpad using the starting address of the secret (0080h). after issuing the load first secret command, the master must provide a 3-byte authorization pattern (ta 1, ta2, e/s, in that order), that should have been obtained by an immediately preced ing read scratchpad command. this 3-byte pattern must exactly match the data contained in the three address registers (see figure 6). if the pattern matches and the secret is not write-protected, the aa flag is set and the copy begins. all eight bytes of scratchpad contents are copied to the secret?s memory location. case en_lfs = 1 to use the load first secret command in this m ode, the refresh scratchpa d command must have been executed to load eight bytes of memory data (a ddress range 0000h to 007fh) into the scratchpad, which sets the en_lfs flag to 1. after issuing the load first secret command, the master must provide a 3-byte authorization pattern (ta1, ta2, e/s, in that order), that can be obtained by an immediately preceding read scratchpad command without affecting the en_lfs flag. this 3-byte pattern must exactly match the data contained in the three address registers (see figure 6). if the pattern matches and the memory is not write-protected, the aa flag is set and the copy begins . all eight bytes of scratchpad contents are copied to the memory location. regardless of the mode used, the dur ation of the copy operation is t prog during which the voltage on the 1-wire bus must not fall below 2.8v. the master should read at least one byte at the conclusion of the copy delay. reading aah indicates that the copy was successful, while reading ffh indicates that the copy was not successful. instead of using load first secret with en_lfs = 0, a new secret can alternatively be loaded with the copy scratchp ad command. however, this approach requires the knowledge of the current secret a nd the computation of a 160-bit mac.
ds1961s 10 of 36 figure 7-1. memory and sha functions flow chart 0fh write scratch- pad ? master tx reset ? master tx data byte to scratch p ad bus master tx ta1 ( t7:t0 ), ta2 ( t15:t8 ) y n n y n address < 90h ? y bus master rx ?1?s master tx reset ? y n ds1961s sets scratchpad byte counter = 0, clears pf, aa, sets t2:t0 = 0, 0, 0, sets e2:e0 = 1, 1, 1 byte counter = 7 ? ds1961s tx crc16 of command, address, data bytes as they were sent by the bus ds1961s increments b y te counter master tx reset ? y n bus master rx ?1?s partial byte ? pf = 1 y n n y to figure 7 2nd part from figure 7 2nd part bus master tx memory function command to rom functions flow chart ( fi g ure 9 ) from rom functions flow chart ( fi g ure 9 ) ds1961s sets en _ lfs = 0 note : see the write scratchpad description for a dditional information.
ds1961s 11 of 36 figure 7-2. memory and sha functions flow chart (continued) aah read scratch- pad ? ds1961s sets scratchpad b y te counter = 0 bus master rx ta1 (t7:t0), ta2 (t15:t8) and e/s b y te bus master rx data b y te from scratch p ad bus master rx crc16 of command, address, e/s byte, data bytes as sent b y the ds1961s y bus master rx ?1?s master tx reset ? y n master tx reset ? ds1961s increments b y te counter byte counter = 7 ? y y n n n from figure 7 1st part to figure 7 1st part to figure 7 3rd part from figure 7 3rd part note : see the read scratchpad description for a dditiona l information.
ds1961s 12 of 36 figure 7-3. memory and sha functions flow chart (continued) * 1-wire idle high for power from figure 7 2nd part to figure 7 2nd part to figure 7 4th part from figure 7 4th part 5ah load first secret ? bus master tx ta1 (t7:t0), ta2 (t15:t8) and e/s b y te y n bus master rx ?1?s master tx reset ? y n note : the 8-byte secret must first be written to the scratch p ad. y auth. code match ? n address of secret ? y n n write- protected ? y ds1961s copies scratch- pad data to address a a = 1 * ds1961s tx ?0? master tx reset ? master tx reset ? y n ds1961s tx ?1? n y address <7fh ? n y en_lfs flag = 1 ? n y duration: t pr og
ds1961s 13 of 36 figure 7-4. memory and sha functions flow chart (continued) 33h compute next secret ? y n * 1-wire idle high for power note : the master must first load the scratchpad with a partial secret of 8 bytes from figure 7 3rd part to figure 7 3rd part from figure 7 5th part to figure 7 5th part valid data address ? y bus master rx ?1?s master tx reset ? y n n n sha engine computes message authentication code of current secret, page data, and 8 byte partial secret in scratch p ad ds1961s copies a partial mac to the secret re g ister master tx reset ? master tx reset ? y n ds1961s tx ?1? ds1961s tx ?0? n y ds1961s fills scratch p ad with a ah * * write- protected ? y bus master tx ta1 ( t7:t0 ), ta2 ( t15:t8 ) ds1961s sets en lfs = 0 duration: t csha duration: t prog
ds1961s 14 of 36 figure 7-5. memory and sha functions flow chart (continued) 55h copy scratch- pad ? y n bus master tx ta1 (t7:t0), ta2 (t15:t8), e/s b y te auth. code match ? n y bus master rx ?1?s master tx reset ? y n a a = 1 ds1961s copies scratch- p ad data to memor y master tx reset ? master tx reset ? y n ds1961s tx ?1? ds1961s tx ?0? n y mac code match ? y n n ds1961s tx ?0?s master tx reset ? y * 1-wire idle high for power sha engine computes message authentication code of secret, 28 bytes of page data, scratchpad data, and device identit y re g ister bus master computes mac and sends it to ds1961s * * from figure 7 4th part to figure 7 4th part to figure 7 6th part from figure 7 6th part bus master waits 10ms write- protected ? y n note : this command is a pplicable to all r/w memor y addresses. duration: t csha duration: t prog
ds1961s 15 of 36 figure 7-6. memory and sha functions flow chart (continued) a5h read auth. page ? y n * 1-wire idle high for power note : three bytes of the scratchpad contents are taken as a challenge to the ds1961s. the master can specify the challenge or accept the current scratchpad contents instead. y n address < 80h ? n bus master rx ?1?s master tx reset ? y ds1961s sets memory a ddress = ( t15:t0 ) master tx reset ? y n bus master rx crc16 of command, address, data , and ffh b y te ds1961s increments address counter master tx reset ? master rx data byte from memor y address n y end of page ? n y master rx one b y te ffh master tx reset ? master tx reset ? y n ds1961s tx ?1? ds1961s tx ?0? n y sha engine computes message authentication code of secret, data of selected page, device identity register and 3-b y te challen g e bus master rx 160-bit messa g e a uth. code bus master rx crc16 of messa g e a uth. code * from figure 7 5th part to figure 7 5th part to figure 7 7th part from figure 7 7th part bus master tx ta1 ( t7:t0 ), ta2 ( t15:t8 ) ds1961s sets en _ lfs = 0 duration: t csha
ds1961s 16 of 36 figure 7-7. memory and sha functions flow chart (continued) a3h refresh scratch- pad ? y n bus master tx ta1 ( t7:t0 ), ta2 ( t15:t8 ) y n bus master rx ?1?s master tx reset ? y n master tx reset ? master tx data byte; ds1961s loads memory b y te to scratch p ad n y ds1961s sets scratch- pad byte counter = 0, clears pf, aa, sets t2:t0 = 0, 0, 0, sets e2:e0 = 1 , 1 , 1 byte counter = 7 ? ds1961s increments b y te counter partial byte ? pf = 1 y n n y to figure 7 8th part from figure 7 8th part from figure 7 6th part to figure 7 6th part ds1961s sets en _ lfs = 0 en _ lfs = 1 ds1961s tx crc16 of command, address, data bytes as they were sent by the bus master master tx reset ? y n bus master rx ?1?s the flag is set only if tar g et address is  7fh. address < 90h ? note : see the refresh scratchpad description for a dditiona l information.
ds1961s 17 of 36 figure 7-8. memory and sha functions flow chart (continued) f0h read memory ? y n from figure 7 7th part to figure 7 7th part address < 98h ? y n y n address of secret ds1961s sets memory a ddress = ( t15:t0 ) ds1961s increments address counter bus master rx ?1?s n address < 97h ? master tx reset ? y n y master tx reset ? bus master rx data byte from memor y address bus master rx ffh b y te y n n bus master rx ?1?s master tx reset ? y bus master tx ta1 ( t7:t0 ), ta2 ( t15:t8 ) ds1961s sets en lfs = 0
ds1961s 18 of 36 compute next secret [33h] some applications may require a higher level of security than can be achieved by a single, directly written secret. for additional security th e ds1961s can compute a new secret based on the current secret, the contents of a selected memory page, and a partial secret that consists of all data in the scratchpad. to install a computed secret the mast er issues the compute next secret command, which activates the 512-bit sha-1 engine, provided that the secret is not wr ite-protected. table 1 shows how the various data components involved enter the sha engine and how a portion of the sha result is loaded into the secret's memory location. the sha computation algorith m itself is explained later in this document. the compute next secret command can be a pplied as often as desired to incr ease the level of security. the bus master does not need to know the device?s current secr et in order to successfully compute a new one and then overwrite the existing secret. table 1. sha-1 input data for compute next secret command m0[31:24] = (ss + 0) m0[23:16] = (ss + 1) m0[15:8] = (ss + 2) m0[7:0] = (ss + 3) m1[31:24] = (pp + 0) m1[23:16] = (pp + 1) m1[15:8] = (pp + 2) m1[7:0] = (pp + 3) m2[31:24] = (pp + 4) m2[23:16] = (pp + 5) m2[15:8] = (pp + 6) m2[7:0] = (pp + 7) m3[31:24] = (pp + 8) m3[23:16] = (pp + 9) m3[15:8] = (pp + 10) m3[7:0] = (pp + 11) m4[31:24] = (pp + 12) m4[23:16] = (pp + 13) m4[15:8] = (pp + 14) m4[7:0] = (pp + 15) m5[31:24] = (pp + 16) m5[23:16] = (pp + 17) m5[15:8] = (pp + 18) m5[7:0] = (pp + 19) m6[31:24] = (pp + 20) m6[23:16] = (pp + 21) m6[15:8] = (pp + 22) m6[7:0] = (pp + 23) m7[31:24] = (pp + 24) m7[23:16] = (pp + 25) m7[15:8] = (pp + 26) m7[7:0] = (pp + 27) m8[31:24] = (pp + 28) m8[23:16] = (pp + 29) m8[15:8] = (pp + 30) m8[7:0] = (pp + 31) m9[31:24] = ffh m9[23:16] = ffh m9[15:8] = ffh m9[7:0] = ffh m10[31:24] = mpx m10[23:16] = (sp + 1) m10[ 15:8] = (sp + 2) m10[7:0] = (sp + 3) m11[31:24] = (sp + 4) m11[23:16] = (sp + 5) m11[15:8] = (sp + 6) m11[7:0] = (sp + 7) m12[31:24] = (ss + 4) m12[23:16] = (ss + 5) m12[15:8] = (ss + 6) m12[7:0] = (ss + 7) m13[31:24] = ffh m13[23:16] = ffh m13[15:8] = ffh m13[7:0] = 80h m14[31:24] = 00h m14[23:16] = 00h m14[15:8] = 00h m14[7:0] = 00h m15[31:24] = 00h m15[23:16] = 00h m15[15:8] = 01h m15[7:0] = b8h result of compute next secret (ss + 0) := e[7:0] (ss + 1) := e[15:8] (ss + 2) := e[23:16] (ss + 3) := e[31:24] (ss + 4) := d[7:0] (ss + 5) := d[15:8] (ss + 6) := d[23:16] (ss + 7) := d[31:24] legend mt input buffer of sha engine 0  t  15; 32-bit words (ss + n) byte n of secret; secret begins at address 0080h (see memory map ) (pp + n) byte n of memory page; memory pages begin at 0000h, 0020h, 0040h and 0060h (see memory map ) (sp + n) byte n of scratchpad mpx mpx[7] = 0; mpx[6] = 0; mpx[5:0] = (sp + 0)[5:0] d, e 32-bit words, portions of the 160-bit sha result after issuing the compute next secret command the master must provide a 2-byte target address to select the memory page that contributes 256 bits of the s ha input data. after receiving the target addresses
ds1961s 19 of 36 (ta1 and ta2), the ds1961s clears the en_lfs flag. th e lower five bits of the target address ta1 are ignored because only the page number is relevant. if the target address as sent by the master is valid (i.e., in the range of 0000h and 007fh), and the secret is not write-protected, the sha engine starts. the master must wait for t csha during which the new secret is computed. immediately following the sha delay, the master must wait for t prog during which the new secret is copied to the secret register. during the t csha and t prog the voltage on the 1-wire bus must not fall below 2.8v. the ds1961s f ills the scratchpad with aah if the copy was successful, but does not modify the scratchpad if the sha engine did not start because of an incorrect address or because of write protection. the master should read at least one byte at the conclusion of the copy delay. reading aah indicates that the copy was successful. reading ffh indicates that the copy was not successful because of an incorrect address or because of write protection. since the content of the scratchpad is used as a partial secret, the master must fill the scratchpad with a known 8-byte data pattern using th e write scratchpad command before it issues the compute next secret command. otherwise the new secret depends on data th at was unintentionally left in the scratchpad from previous commands. copy scratchpad [55h] the data memory of the ds1961s can be read wit hout any restrictions. executing the copy scratchpad command to write new data to the memory or regi ster page, however, requires the knowledge of the device?s secret and the ability to perform an sha-1 co mputation to generate the 160-bit mac to start the data transfer from the scratchpad to the memory. the master can perform the mac computation in software or use a ds1963s as a copr ocessor. the coprocessor approach has the benefit that the secret remains hidden in the coprocessor ibutton. the sequence in which the resulting mac needs to be sent to the ds1961s is shown in table 2. ta bles 3a and 3b show how the va rious data components are entered into the sha engine. the sha computation algorithm is explained later in this document. table 2. message authentication code transmission sequence e[31:24] e[23:16] e[15:8] e[7:0] d[31:24] d[23:16] d[15:8] d[7:0] c[31:24] c[23:16] c[15:8] c[7:0] b[31:24] b[23:16] b[15:8] b[7:0] a[31:24] a[23:16] a[15:8] a[7:0] the transmission is least significant bit first starting with register e. after issuing the copy scratchpad command, the mast er must provide a 3-byte authorization pattern, which should have been obtained by an immediatel y preceding read scratchpad command. this 3-byte pattern must exactly match the data contained in the three address registers (ta1, ta2, e/s, in that order). if the authorization code matches and the target memory is not write-protected, the ds1961s starts its sha engine to compute a 160-bit mac that is based on the current secr et, all of the scratchpad data, the first 28 bytes of the addre ssed memory page, and the first seven bytes of the identity register (the byte at address 0097h is not used; see table 3a ). the duration of this computation is t csha , during which the voltage on the 1-wire line must not drop belo w 2.8v. simultaneously the master computes a mac from the same data and, after t csha is expired, sends it to the ds1961s as evidence that it is authorized to write to the eeprom. now the master waits for t prog during which the voltage on the 1-wire bus must shift direction
ds1961s 20 of 36 not fall below 2.8v. if the mac generated by the ds 1961s matches the mac that the master computed, the ds1961s sets its aa flag, and copy the entire sc ratchpad contents to the data eeprom. the master should read at least one byte at the conclusion of the copy delay. reading aah indicates that the copy was successful. reading 00h indicates that the copy was not successf ul because the computed mac did not match the mac sent by the master. reading ffh indicates that the copy was not successful because of write protection or because of an incorrect authorization pattern. table 3a. sha-1 input data for copy scratchpad command when copying to a data memory page m0[31:24] = (ss + 0) m0[23:16] = (ss + 1) m0[15:8] = (ss + 2) m0[7:0] = (ss + 3) m1[31:24] = (pp + 0) m1[23:16] = (pp + 1) m1[15:8] = (pp + 2) m1[7:0] = (pp + 3) m2[31:24] = (pp + 4) m2[23:16] = (pp + 5) m2[15:8] = (pp + 6) m2[7:0] = (pp + 7) m3[31:24] = (pp + 8) m3[23:16] = (pp + 9) m3[15:8] = (pp + 10) m3[7:0] = (pp + 11) m4[31:24] = (pp + 12) m4[23:16] = (pp + 13) m4[15:8] = (pp + 14) m4[7:0] = (pp + 15) m5[31:24] = (pp + 16) m5[23:16] = (pp + 17) m5[15:8] = (pp + 18) m5[7:0] = (pp + 19) m6[31:24] = (pp + 20) m6[23:16] = (pp + 21) m6[15:8] = (pp + 22) m6[7:0] = (pp + 23) m7[31:24] = (pp + 24) m7[23:16] = (pp + 25) m7[15:8] = (pp + 26) m7[7:0] = (pp + 27) m8[31:24] = (sp + 0) m8[23:16] = (sp + 1) m8[15:8] = (sp + 2) m8[7:0] = (sp + 3) m9[31:24] = (sp + 4) m9[23:16] = (s + 5) m9[15:8] = (sp + 6) m9[7:0] = (sp + 7) m10[31:24] = mp m10[23:16] = (id + 0) m10[15:8] = (id + 1) m10[7:0] = (id + 2) m11[31:24] = (id + 3) m11[23:16] = (id + 4) m11[15:8] = (id + 5) m11[7:0] = (id + 6) m12[31:24] = (ss + 4) m12[23:16] = (ss + 5) m12[15:8] = (ss + 6) m12[7:0] = (ss + 7) m13[31:24] = ffh m13[23:16] = ffh m13[15:8] = ffh m13[7:0] = 80h m14[31:24] = 00h m14[23:16] = 00h m14[15:8] = 00h m14[7:0] = 00h m15[31:24] = 00h m15[23:16] = 00h m15[15:8] = 01h m15[7:0] = b8h legend mt input buffer of sha engine 0  t  15; 32-bit words (ss + n) byte n of secret; secret begins at address 0080h (see memory map ) (pp + n) byte n of memory page; memory pages begin at 0000h, 0020h, 0040h and 0060h (see memory map ) (sp + n) byte n of scratchpad mp mp[7:3] = 00000b, mp[2:0] = t7:t5 (id + n) byte n of identity register the last byte of the identity register is not used. special attention is required when copying data to the register page. in order to prevent unintentional locking of a special function register or user byte it is recommended to first read the register page and then write it with all intended modifications to the scratchpad. when copying data to the register page (or the secret using copy scratchpad), the input data for m1 to m7 of the sha engine is the current secret (m1, m2), the current content of the register page (m3, m4), the full content of the identity register (m5, m6), and 4 bytes ffh (m7), as shown in table 3b. as a consequence, when using a ds1963s as coprocessor to compute the mac to transfer data from the scratchpad to the register page, the secret must be used as page data. this precludes the use of partial (computed) secrets if writing to the register page is
ds1961s 21 of 36 required. for practical use of the ds1961s as a monetary token, partia l secrets are more critical than being able to write-protect the secr et or other areas of the device. table 3b. sha-1 input data for copy scratchpad command when copying to the register page or secret m0[31:24] = (ss + 0) m0[23:16] = (ss + 1) m0[15:8] = (ss + 2) m0[7:0] = (ss + 3) m1[31:24] = (ss + 0) m1[23:16] = (ss + 1) m1[15:8] = (ss + 2) m1[7:0] = (ss + 3) m2[31:24] = (ss + 4) m2[23:16] = (ss + 5) m2[15:8] = (ss + 6) m2[7:0] = (ss + 7) m3[31:24] = (rp + 0) m3[23:16] = (rp + 1) m3[15:8] = (rp + 2) m3[7:0] = (rp + 3) m4[31:24] = (rp + 4) m4[23:16] = (rp + 5) m4[15:8] = (rp + 6) m4[7:0] = (rp + 7) m5[31:24] = (id + 0) m5[23:16] = (id + 1) m5[15:8] = (id + 2) m5[7:0] = (id + 3) m6[31:24] = (id + 4) m6[23:16] = (id + 5) m6[15:8] = (id + 6) m6[7:0] = (id + 7) m7[31:24] = ffh m7[23:16] = ffh m7[15:8] = ffh m7[7:0] = ffh m8[31:24] = (sp + 0) m8[23:16] = (sp + 1) m8[15:8] = (sp + 2) m8[7:0] = (sp + 3) m9[31:24] = (sp + 4) m9[23:16] = (sp + 5) m9[15:8] = (sp + 6) m9[7:0] = (sp + 7) m10[31:24] = mp m10[23:16] = (id + 0) m10[15:8] = (id + 1) m10[7:0] = (id + 2) m11[31:24] = (id + 3) m11[23:16] = (id + 4) m11[15:8] = (id + 5) m11[7:0] = (id + 6) m12[31:24] = (ss + 4) m12[23:16] = (ss + 5) m12[15:8] = (ss + 6) m12[7:0] = (ss + 7) m13[31:24] = ffh m13[23:16] = ffh m13[15:8] = ffh m13[7:0] = 80h m14[31:24] = 00h m14[23:16] = 00h m14[15:8] = 00h m14[7:0] = 00h m15[31:24] = 00h m15[23:16] = 00h m15[15:8] = 01h m15[7:0] = b8h legend mt input buffer of sha engine 0  t  15; 32-bit words (ss + n) byte n of secret; secret begins at address 0080h (see memory map ) (rp + n) byte n of register page; page begins at 0088h (see memory map ) (sp + n) byte n of scratchpad mp mp[7:0] = 04h (id + n) byte n of identity register read authenticated page [a5h] the read authenticated page command provides the master with the data of a full or partial memory page plus a mac. the mac allows the master to determin e whether the secret stor ed in the ds1961s is valid within the application. the ds1961s computes the mac from its secret, all the data of the selected memory page, the first seven bytes of the identity register and a 3-byte challenge, which the master should write to the scratchpad prior to issuing th e read authenticated page command. to do this, the master can use the write scratchpad command with any target address within the data memory. the relevant portions of the challenge are the 5th, 6 th , and 7th bytes. alternatively, the master can accept the data that happens to reside in the scratchpad from a previous command as a challenge. the 160-bit mac is transmitted in the same way as with the copy scratchpad command, table 2, but the data flows from the ds1961s to the master. the data input to the sha engine as it applies to the read authenticated page command is shown in table 4.
ds1961s 22 of 36 after the master has issued the command code and specified the target addresses (ta1 and ta2), the ds1961s first clears the en_lfs flag. if the target a ddress is valid (< 0080h), th e master receives the page data beginning at the target address through the end of the data page, one byte ffh and the inverted crc of the command code, target address, transmitted page data and ffh byte. if the target address is invalid (  0080h), the master receives ffh bytes rather than page data. immediately after the crc is received, the master waits for t csha during which the voltage on the 1- wire bus must not fall below 2.8v. during this time the sha engine of the ds1961s co mputes the message authentication code over the secret, all 32 data bytes of the selected page, the device?s registration number (without the crc) and the 3-byte challenge. now the master reads the 160-bit mac, which is followed by an inverted crc as a means to safeguard the data transfer. if the ma ster continues reading after the crc it receives aah. table 4. sha-1 input data for read authenticated page command m0[31:24] = (ss + 0) m0[23:16] = (ss + 1) m0[15:8] = (ss + 2) m0[7:0] = (ss + 3) m1[31:24] = (pp + 0) m1[23:16] = (pp + 1) m1[15:8] = (pp + 2) m1[7:0] = (pp + 3) m2[31:24] = (pp + 4) m2[23:16] = (pp + 5) m2[15:8] = (pp + 6) m2[7:0] = (pp + 7) m3[31:24] = (pp + 8) m3[23:16] = (pp + 9) m3[15:8] = (pp + 10) m3[7:0] = (pp + 11) m4[31:24] = (pp + 12) m4[23:16] = (pp + 13) m4[15:8] = (pp + 14) m4[7:0] = (pp + 15) m5[31:24] = (pp + 16) m5[23:16] = (pp + 17) m5[15:8] = (pp + 18) m5[7:0] = (pp + 19) m6[31:24] = (pp + 20) m6[23:16] = (pp + 21) m6[15:8] = (pp + 22) m6[7:0] = (pp + 23) m7[31:24] = (pp + 24) m7[23:16] = (pp + 25) m7[15:8] = (pp + 26) m7[7:0] = (pp + 27) m8[31:24] = (pp + 28) m8[23:16] = (pp + 29) m8[15:8] = (pp + 30) m8[7:0] = (pp + 31) m9[31:24] = ffh m9[23:16] = ffh m9[15:8] = ffh m9[7:0] = ffh m10[31:24] = mp m10[23:16] = (id + 0) m10[15:8] = (id + 1) m10[7:0] = (id + 2) m11[31:24] = (id + 3) m11[23:16] = (id + 4) m11[15:8] = (id + 5) m11[7:0] = (id + 6) m12[31:24] = (ss + 4) m12[23:16] = (ss + 5) m12[15:8] = (ss + 6) m12[7:0] = (ss + 7) m13[31:24] = (sp + 4) m13[23:16] = (sp + 5) m13[15:8] = (sp + 6) m13[7:0] = 80h m14[31:24] = 00h m14[23:16] = 00h m14[15:8] = 00h m14[7:0] = 00h m15[31:24] = 00h m15[23:16] = 00h m15[15:8] = 01h m15[7:0] = b8h legend mt input buffer of sha engine 0  t  15; 32-bit words (ss + n) byte n of secret; secret begins at address 0080h (see memory map ) (pp + n) byte n of memory page; memory pages begin at 0000h, 0020h, 0040h and 0060h (see memory map ) (sp + n) byte n of scratchpad mp mp[7:3] = 01000b, mp[2:0] = t7:t5 (id + n) byte n of identity register the last byte of the identity register is not used.
ds1961s 23 of 36 refresh scratchpad [a3h] refresh scratchpad loads memory data to the scratchpad and sets the en_lfs flag, which enables the use of the load first secret command to re-write the data that was just read from the memory, bypassing the mac computation of copy scratchpad. the command flow chart of refresh scratchpad is very similar to write scratchpad. if the target address is between 0000h?007fh, there are two primary differences. 1) the data bytes that the master transmits following the target address are discarded; instead, the scratchpad is loaded with the unaltered memory data located at the target address, even if the memory page is in eprom mode. 2) after the master has transmitted the eight dummy bytes, the en_lfs flag is set to 1. the en_lfs flag is cleared to 0 after receiving ta1 and ta2 during a write scratchpad, compute next secret, read authenticated page, refresh scratch, read memory, or by a power-on reset, because these commands can change the target address and/or the data in the scratchpad. when applied to addresses 0080h?008fh, the refres h scratchpad command beha ves the same way as write scratchpad. this protects the secret from being exposed by a subsequent read scratchpad command. read memory [f0h] the read memory command can be used to read all memory except for the secret. attempting to read the secret results in ffh bytes instead of the actual secret. after the master has issued the command code and specified the target addresses (ta1 and ta2), the ds1961s first clears the en _lfs flag. if the target address is valid, the master reads data beginning from the target address and can continue until address 0097h. if the master continues reading, the result is lo gic 1s. it is important to realize that the target address registers point to the last byte read. the ending offset/data status byte and the scratchpad are unaffected. the hardware of the ds1961s provides a means to ac complish error-free writing to the memory section. to safeguard reading data in the 1-wire environment and to simultaneously speed up data transfers, it is recommended to packetize data into data packets of the size of one memory page each. such a packet typically stores a master-calculated 16-bit crc with each page of data to ensure rapid, error-free data transfers that eliminate having to read a page multiple times to determine if the received data is correct or not. (refer to application note 114 for the recommended file structure, which is also referred to as tmex format.)
ds1961s 24 of 36 sha-1 computation algorithm this description of the sha com putation is adapted from the secure hash standard sha-1 document that can be downloaded from the nist website (www.itl.nist.gov/fipspubs/fip180-1.htm). the algorithm takes as its input data sixteen 32-bit words m t (0  t  15), as shown in tables 1, 3a, 3b, and 4 for the compute next secret, copy scratchpad, and read authenticated page command, respectively. the sha computation involves a sequence of eighty 32-bit words called w t (0  t  79), a sequence of eighty 32- bit words called k t (0  t  79), a boolean function f t (b, c, d) (0  t  79) with b, c, and d being 32-bit words, and three more 32-bit words called a, e, and tmp. the operations required for the sha computation are arithmetic addition without carry (?+?), logical inve rsion or 1?s complement (?\?), exclusive or (?  ?), logical and (?  ?), logical or (?  ?), assignment (?:=?), and circular shifting within a 32-bit word. the expression ?s n (x)? represents a circular shift of x by n positions to the left, with x being a 32-bit word. the function f t is defined as follows: f t (b,c,d) = (b  c)  ((b\)  d) (0  t  19) b  c  d (20  t  39) (b  c)  (b  d)  (c  d) (40  t  59) b  c  d (60  t  79) the sequence w t (0  t  79) is defined as follows: w t := m t (0  t  15) s 1 (w t-3  w t-8  w t-14  w t-16 ) (16  t  79) the sequence k t (0  t  79) is defined as follows: k t := 5a827999h (0  t  19) 6ed9eba1h (20  t  39) 8f1bbcdch (40  t  59) ca62c1d6h (60  t  79) the variables a, b, c, d, e are initialized as follows: a := 67452301h b := efcdab89h c := 98badcfeh d := 10325476h e:= c3d2e1f0h the 160-bit mac is the concatenation of a, b, c, d, and e after looping through the following set of computations for t = 0 to 79 (discarding any carry-out): tmp := s 5 (a) + f t (b,c,d) + w t + k t + e e:= d d:= c c:= s 30 (b) b:= a a:= tmp
ds1961s 25 of 36 the master can read the mac with the read authenticated page command in a register and bit sequence as shown in table 3. with the copy scratchpad command the bit transmission sequence is the same, however, the master has to compute the mac and se nd it to the ds1961s. with the compute next secret command the mac is not exposed. instead, the contents of the d and e sha computation registers are directly copied to the se cret, as shown in table 1. 1-wire bus system the 1-wire bus is a system, which has a single bus master and one or more slaves. in all instances the ds1961s is a slave device. the bus ma ster is typically a microcontroller. for small configurations the 1- wire communication signals can be generated under so ftware control using a single port pin. for larger configurations, the ds2480b 1-wire line driver chip or serial port adapters based on this chip (ds9097u series) are recommended. this simplifies the hardware design and frees the microprocessor from responding in real-time. the discussion of this bus system is broken down into three topics: hardware configuration, transaction sequence, and 1-wire signaling (signal types and timing). the 1-wire protocol defines bus transactions in terms of the bus state during specific time slots that are initiated on the falling edge of sync pulses from the bus master. for a more detailed protoc ol description, refer to chapter 4 of the book of ds19xx ibutton standards . hardware configuration the 1-wire bus has only a single line by definition; it is important that each device on the bus be able to drive it at the appropriate time. to facilitate this, each device attached to the 1-wire bus must have open- drain or tri-state outputs. the 1-wire port of the ds1961s is open drain w ith an internal circuit equivalent to that shown in figure 8. a multidrop bus consists of a 1-wire bus with multiple slaves attached. at standard speed the 1-wire bus has a maximum data rate of 16.3kbps. the speed can be boosted to 142kbps by activating the overdrive mode. the ds1961s is not guaranteed to be fully co mpliant to the ibutton st andard. its maximum data rate in standard speed mode is 14.1kbps and 125kbps in overdrive. the ds1961s requires a 1-wire pullup resistor of maximum 2.2k  for executing any of its memory and sha function commands at any speed. when communicating with several ds1961s simu ltaneously, e.g., to inst all the same secret in several devices, the resistor should be bypassed by a low-impedance pullup to v pup while the device transfers data from the scratchpad to the eeprom. the idle state for the 1-wire bus is high. if for any reason a transaction needs to be suspended, the bus must be left in the idle state if the transaction is to resume. if this does not occur and the bus is left low for more than 16s (overdrive speed) or more than 120s (regular speed), one or more devices on the bus can be reset. with the ds1961s the bus must be le ft low for no longer than 15.2s at overdrive speed to ensure that none of the slave devices on the 1-wi re bus performs a rese t. despite of its limited compliance, the ds1961s communicat es properly when used in conjunction with a ds2480b 1-wire driver and serial port adapters th at are based on this driver chip.
ds1961s 26 of 36 figure 8. hardware configuration open-drain port pin rx = receive tx = transmit 100  mosfet v pup rx tx tx rx data r pu 5a (typ) bus master ds1961s 1-wire port transaction sequence the protocol for accessing the ds1961s th rough the 1-wire port is as follows:  initialization  rom function command  memory or sha function command  transaction/data initialization all transactions on the 1-wire bus begin with an initialization sequence. the initialization sequence consists of a reset pulse transmitted by the bus master followed by presence pulse(s) transmitted by the slave(s). the presence pulse lets the bus master know that the ds1961s is on the bus and is ready to operate. for more details, see the 1-wire signaling section. rom function commands once the bus master has detected a presence, it can issue one of the seven rom function commands that the ds1961s supports. all rom function commands ar e eight bits long. a list of these commands follows (see the flow chart in figure 9): read rom [33h] this command allows the bus master to read th e ds1961s?s 8-bit family code, unique 48-bit serial number, and 8-bit crc. this command should only be used if there is a single slave on the bus. if more than one slave is present on the bus, a data collision occurs when all slaves try to transmit at the same time (open drain produces a wired-and result). the resultant family code and 48-bit serial number read by the master are invalid. match rom [55h] the match rom command, followed by a 64-bit registrati on number, allows the bus master to address a specific ds1961s on a multidrop bus. only the ds1961s that exactly matches the 64-bit registration number responds to the following memory function command. all other slaves wait for a reset pulse. this command can be used with single or multiple devices on the bus.
ds1961s 27 of 36 figure 9-1. rom functions flow chart from figure 9 2nd part to memory functions flow chart ( fi g ure 7 ) master tx bit 0 master tx bit 63 master tx bit 1 bit 63 match ? rc = 0 ds1961s tx bit 0 ds1961s tx bit 0 master tx bit 0 ds1961s tx bit 1 ds1961s tx bit 1 master tx bit 1 ds1961s tx bit 63 ds1961s tx bit 63 master tx bit 63 rc = 1 bit 1 match ? bit 0 match ? y n y n y n bit 63 match ? rc = 0 rc = 1 bit 1 match ? bit 0 match ? y n y n y n rc = 0 ds1961s tx crc b y te ds1961s tx serial number (6 bytes) ds1961s tx family code (1 byte) rc = 0 to figure 9 2nd part n f0h search rom command ? n 55h match rom command ? n cch skip rom command ? y y y y n 33h read rom command ? to figure 9 2nd part from memory functions flow chart ( fi g ure 9 ) bus master tx rom function command ds1961s tx presence pulse od reset pulse ? n y od = 0 bus master tx reset pulse from fi g ure 9, 2nd part
ds1961s 28 of 36 figure 9-2. rom functions flow chart to figure 9 1st part from figure 9 1st part from figure 9 1st part to fi g ure 9, 1st part y n a5h resume command ? rc = 1 ? y n 3ch overdrive skip rom ? rc = 0 ; od = 1 master tx reset ? y n n y master tx reset ? n y master tx bit 0 master tx bit 63 master tx bit 1 bit 63 match ? rc = 0 ; od = 1 rc = 1 bit 1 match ? y n y n bit 0 match ? y n y n 69h overdrive match rom ?
ds1961s 29 of 36 search rom [f0h] when a system is initially brought up, the bus mast er may not know the number of devices on the 1-wire bus or their 64-bit registration numbers. the sear ch rom command allows the bus master to use a process of elimination to identify the 64-bit numbers of all slave devices on the bus. the search rom process is the repetition of a simple 3-step routine: read a bit, read the complement of the bit, then write the desired value of that bit. the bus master performs this 3-step routine on each bit of the registration number. after one complete pass, the bus master knows the 64-bit number of one device. additional passes will identify the registration numbers of the remaining devices. refer to chapter 5 of the book of ds19xx ibutton standards for a detailed discussion of a search rom, including an actual example. skip rom [cch] this command can save time in a single drop bus system by allowing the bus master to access the memory and sha functions without providing the 64-bit registration number. if more than one slave is present on the bus and, for example, a read comma nd is issued following the skip rom command, data collision occurs on the bus as multiple slaves tran smit simultaneously (open-drain pulldowns produce a wired-and result). resume command [a5h] in a typical application the ds1961s needs to be acce ssed several times to write a full 32-byte page. in a multidrop environment this means that the 64-bit registration number of a match rom command has to be repeated for every access. to maximize the da ta throughput in a multidrop environment the resume command function was impleme nted. this function checks the status of the rc bit and, if it is set, directly transfers control to the memory and s ha functions, similar to a skip rom command. the only way to set the rc bit is through successfully executing the match rom, search rom, or overdrive match rom command. once the rc bit is set, the device can repeatedly be accessed through the resume command function. accessing another device on the bus clears the rc bit, preventing two or more devices from simultaneously responding to the resume command function. overdrive skip rom [3ch] on a single-drop bus this command can save time by allowing the bus master to access the memory and sha functions without providing the 64-bit regist ration number. unlike the normal skip rom command the overdrive skip rom sets the ds1961s in the ove rdrive mode (od = 1). all communication following this command code has to occur at overdrive speed until a reset pulse of minimum 480s duration resets all devices on the bus to regular speed (od = 0). when issued on a multidrop bus this command sets all overdrive-supporting devices into overdrive mode. to subsequently address a specific overdrive- supporting device, a reset pulse at overdrive speed ha s to be issued followed by a match rom or search rom command sequence. this speeds up the search proc ess. if more than one slave supporting overdrive is present on the bus and the overdrive skip rom command is followed by a read command, data collision occurs on the bus as multiple slaves tran smit simultaneously (open-drain pulldowns produce a wired-and result). overdrive match rom [69h] the overdrive match rom command, followed by a 64- bit registration number transmitted at overdrive speed, allows the bus master to address a specifi c ds1961s on a multidrop bus and to simultaneously set it in overdrive mode. only the ds1961s that ex actly matches the 64-bit number responds to the subsequent memory or sha function command. slav es already in overdrive mode from a previous overdrive skip or a successful overdrive match command will remain in overdrive mode. all overdrive- capable slaves return to regular speed at the ne xt reset pulse of minimum 480s duration. the overdrive match rom command can be used with single or multiple devices on the bus.
ds1961s 30 of 36 1-wire signaling the ds1961s requires strict pr otocols to ensure data integrity. th e protocol consists of four types of signaling on one line: reset sequence with reset pulse and presence pulse, write 0, write 1, and read data. except for the presence pulse the bus master initiate s all of these signals. the ds1961s can communicate at two different speeds: standard sp eed and overdrive speed. if not exp licitly set into the overdrive mode, the ds1961s communicates at standard speed. while in overdrive mode the fast timing applies to all waveforms. to get from idle to active, the voltage on the 1-wire line needs to fall from v pup below the threshold v tl . to get from active to idle, the voltage needs to rise from v ilmax past the threshold v th . the voltage v ilmax is relevant for the ds1961s when determining a lo gical level, but not for triggering any events. the initialization sequence required to begin any co mmunication with the ds1961s is shown in figure 10. a reset pulse followed by a presence pulse indicat es the ds1961s is ready to receive data, given the correct rom and memory function command. in a mixed population network, the reset low time t rstl needs to be long enough for the slowest 1-wire slave device to recognize it as a reset pulse. the duration of t rstl depends on the communication speed and th e 1-wire pull-up voltage (see electrical characteristics). if the bus master uses slew-rate control on the falling edge, it must pull down the line for t rstl + t f to compensate for the edge. if the ds1961s is in overdrive mode, a standard speed reset pulse will return the device to standard speed. fo r the ds1961s to remain in overdrive mode, t rstl must not exceed the maximum value specified for overdrive speed. figure 10. initialization procedure (reset and presence pulses) resistor master ds1961s t rstl t pdl t rsth t pdh master tx reset pulse master rx presence pulse v pup v ihmaster v th v tl v ilmax 0v  t f t rec t msp after the bus master has released the line it goes into receive mode (rx). now the 1-wire bus is pulled to v pup through the pullup resistor or, in case of a ds2480b driver, by active circuitry. when the threshold v th is crossed, the ds1961s waits for t pdh and then transmits a presence pulse by pulling the line low for t pdl . to detect a presence pulse, the master must test the logical state of the 1-wire line at t msp . the t rsth window must be at least the sum of t pdhmax , t pdlmax , and t recmin . immediately after t rsth is expired, the ds1961s is ready for data co mmunication. in a mixed population network, t rsth should be extended to minimum 480s at standard speed and 48 s at overdrive speed to accommodate other 1-wire devices.
ds1961s 31 of 36 read-/write-time slots data communication with the ds1961s takes place in time slots that car ry a single bit each. write-time slots transport data from bus master to slave. read-time slots transfer data from slave to master. the definitions of the write- and read-time slots are illustrated in figure 11. all communication begins with the master pulling the data line low. as the voltage on the 1-wire line falls below the threshold v tl , the ds1961s starts its internal time base. the tolerance of the slave time base creates a slave-sampling window that stretches from t slsmin to t slsmax . the voltage on the data line at the sampling point determines whether the ds1961s decodes the time slot as 1 or 0. for reliable communication the voltage has to be either below the v ilmax or above the maximum v th value during the entire sampling window. master-to-slave for a write-one time slot, the master pulldown time (t mpd1 = t w1l -  + t f ) must be short enough to allow the voltage on the 1-wire line to reach v th at t slsmin , the earliest sampling point of a ds1961s. after the latest sampling point (t slsmax ) there needs to be a recovery time (t rec ) before the next time slot can start. for a write-zero time slot, the master pulldown time (t mpd0 = t w0l + t f ) must be long enough to keep the voltage on the data line below v ilmax at the sampling point of a slow ds1961s, which is t slsmax . before the next time slot can start, the voltage on the data line first needs to rise above v th and remain there until the recovery time t rec is expired. slave-to-master a read-data time slot is very similar to a write-one time slot. the master begins a read-data time slot with pulling the data line low. as the voltage on the 1-wire line falls below the threshold v tl , the ds1961s starts its internal time base. the master pulldown time (t mpdr = t rl + t f ) must be long enough to cover the setup time t su , after which the ds1961s delivers a bit to its 1-wire port. when transmitting a 0, the ds1961s holds the data line low for t spd . if the data bit is a 1, the ds1961s does not hold the data line low at all. the master samples the data line at t msr , inside a window that is determined by the sum of t rl and the rise time (  ) on one side and t spdmin on the other side. the optimum sample point for a read-zero case is no later than t spdmin . in case of a read-one, the voltage on th e 1-wire line must be able to reach v ihmaster at t msr . this condition determines the maximum duration of the master pulldown time. for reliable communication, the master pulldown time should be as short as possible, maximizing the time for the data line to reach v ihmin . before the next time slot can start, t spdmax needs to be over and the voltage on the data line must have risen above v th and remained there until the recovery time t rec is expired.
ds1961s 32 of 36 figure 11. read/write timing diagrams write-one time slot resistor master ds1961s v pup v ihmaster v th v tl v ilmax 0v ds1961s sampling window t slsmin t rec t f t slot t w1l t slsmax  write-zero time slot resistor master ds1961s t rec v pup v ihmaster v th v tl v ilmax 0v ds1961s sampling window t slsmin t f t slot t slsmax t w0l read-data time slot resistor master ds1961s t rec v pup v ihmaster v th v tl v ilmax 0v master sampling window t spdmin  t f t slot t rl t msr t spdmax crc generation with the ds1961s there are two differe nt types of crcs. one crc is an 8-bit type. it is computed at the factory and lasered into the most significant byte of the 64-bit rom. the equivalent polynomial function of this crc is x 8 + x 5 + x 4 + 1. to determine whether the rom data has been read without error the bus master can compute the crc value from the first 56 bits of the 64-bit rom and compare it to the value
ds1961s 33 of 36 read from the ds1961s. this 8-bit crc is received in the true form (noninverted) when reading the rom. the other crc is a 16-bit type, generated according to the standardized crc16-polynomial function x 16 + x 15 + x 2 + 1. this crc is used for error detection with the read authenticated page command, when reading the scratchpad and for fast verification of a data transfer when writing to the scratchpad or with refresh scratchpad. it is the same type of crc as is used for error detection within the ibutton extended file structure. in contrast to the 8-bit crc, the 16-bit crc is always returned or sent in the complemented (inverted) form. a crc-generator inside the ds1961s chip (figure 12) calculates a new 16-bit crc as shown in the command flow chart of figure 7. the bus master can compare the crc value read from the device to the one it calculates from the data and decide whether to continue with an operation or to re-read the portion of the data with the crc error. with write scratchpad, as well as refresh scratchpad, the crc is generated by first clearing the crc generator and then shifting in the command code, the target addresses ta1 (with t2 to t0 set to 0) and ta2, and all data bytes as sent by the master. the ds1961s transmits this crc only if the master has sent exactly eight bytes. with the read scratchpad command the crc is generated by first clearing the crc generator and then shifting in the command code, the target addresses ta 1 and ta2, the e/s byte, and the scratchpad data, which may have been modified by the ds 1961s (see write scratchpad command). the ds1961s transmits this crc only if the reading continues through the end of the scratchpad. with the read authenticated page command the 16-bit crc value is the result of shifting the command byte into the cleared crc generator, followed by the two address bytes, the data bytes, and the ffh byte. the crc that follows the mac results from clearing the crc generator and then shifting in the 160-bit mac in the same bit sequence as the master receives it. for more details on generating crc values including example implementations in both hardware and software, refer to the book of ds19xx ibutton standards . figure 12. crc-16 hardware description and polynomial polynomial = x 16 + x 15 + x 2 + 1 x 0 x 1 x 2 x 3 x 4 x 5 x 6 x 7 x 8 x 9 x 10 x 11 x 12 x 13 x 14 x 15 x 16 1 st stage 2 nd stage 3 rd stage 4 th stage 6 th stage 5 th stage 7 th stage 8 th stage 9 th stage 10 th stage 11 th stage 12 th stage 13 th stage 14 th stage 15 th stage 16 th stage input data crc output
ds1961s 34 of 36 absolute maximum ratings* i/o voltage to gnd -0.5v, +6v i/o sink current 20ma temperature range -40c to +85c junction temperature +150c storage temperature range -55c to +85c * this is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operation sections of this specification is not implied. exposure to absolute maximum rating conditions for extended periods of time may affect reliability. electrical characteristics parameter symbol conditions min typ max units notes operating temperature t a all, except eeprom programming -40 85 c 1 all -20 85 1-wire pullup v pup standard speed 2.8 5.25 v 1 overdrive speed 3.3 5.25 i/o pin general data 1-wire pullup resistance r pup 2.2 k  1, 2 input capacitance c io 100 800 pf 3, 14 input load current i l i/o pin at v pup 110a4 high-to-low switching threshold v tl 1.5 v 5, 6, 7, 14 input low voltage v il 0.30 v 1, 5, 8 low-to-high switching threshold v th 1.5 v 5, 6, 9, 14 output low voltage at 4ma v ol 0.4 v 5, 10 recovery time t rec standard speed, r pup = 2.2k  5 s 1, 14 overdrive speed, r pup = 2.2k  2 overdrive speed, directly prior to reset pulse; r pup = 2.2k  5 timeslot duration t slot standard speed 65 s 1, 13 overdrive speed, v pup > 4.5v 7 overdrive speed 9 i/o pin, 1-wire reset, presence detect cycle reset low time t rstl standard speed, v pup > 4.5v 480 640 s 1, 13 standard speed 720 960 overdrive speed, v pup > 4.5v 60 80 overdrive speed 68 80
ds1961s 35 of 36 parameter symbol conditions min typ max units notes presence detect high t pdh standard speed 15 60 s 13 time overdrive speed, v pup > 4.5v 1 5 overdrive speed 1 6.7 presence detect low t pdl standard speed 60 285 s 13 time overdrive speed, v pup > 4.5v 7.3 24 overdrive speed 7.3 28 presence detect t msp standard speed 60 75 s 1, 14 sample time overdrive speed, v pup > 4.5v 5 8.3 overdrive speed 6.7 8.3 i/o pin, 1-wire write write-0 low time t w0l standard speed 60 120 13, 1 overdrive speed, v pup > 4.5v 5 14 overdrive speed 7 14 write-1 low time t w1l standard speed 5 15 -  s 1, 11, 13 overdrive speed, v pup > 4.5v 1 2 -  overdrive speed 1 1.85 -  write sample time (slave sampling) t sls standard speed 15 60 s 13 overdrive speed, v pup > 4.5v 25 overdrive speed 1.85 7 i/o pin, 1-wire read read low time t rl standard speed 5 15 -  s 1, 12,13 overdrive speed, v pup > 4.5v 1 2 -  overdrive speed 1 1.85 -  read-0 low (data from slave) t spd standard speed 15 60 s 13 overdrive speed, v pup > 4.5v 25 overdrive speed 1.85 7 read sample time t msr standard speed t r l +  15 s 1, 12, 13 overdrive speed, v pup > 4.5v t r l +  2 overdrive speed t r l +  1.85 eeprom programming current i lprog 700 a 14 programming time t prog 10 ms write/erase cycles n cycle 50k ? 14 data retention t ret +85c, not powered 10 years
ds1961s 36 of 36 parameter symbol conditions min typ max units notes sha-1 engine computation current i lcsha 4.5 ma 14 computation time t csha 1.5 ms notes: 1) system requirement. 2) maximum allowable pullup resistance is a function of the number of 1-wire devices in the system and 1-wire recovery times. the specified value here applies to systems with only one device and with the minimum 1-wire recovery times. for more heavily loaded systems, an active pullup such as that found in the ds2480b may be required. 3) capacitance on the data pin could be 800pf when power is first applied. if a 5k  resistor is used to pull up the data line to v pup; the parasite capacitance does not affect normal communications 5s after power has been applied. 4) input load is to ground. 5) all voltages are referenced to ground. 6) v tl , v th are a function of the internal supply voltage. 7) voltage below which, during a falling edge on i/o, a logic 0 is detected. 8) the voltage on i/o needs to be less or equal to v ilmax whenever the master drives the line low. 9) voltage above which, during a rising edge on i/o, a logic 1 is detected. 10) the i-v characteristic is linear for voltages less than 1v. 11)  is the time required for the pullup circuitry to pull the voltage on i/o up from v il to v th . 12)  represents the time required for the pullup circuitry to pull the voltage on i/o up from v il to the input high threshold of the bus master. 13) highlighted numbers are not in compliance with the published ibutton standards. see comparison table below. 14) guaranteed by design, not production tested standard values ds1961s values parameter standard speed overdrive speed standard speed overdrive speed name min max min max min max min max t slot (incl. t rec ) 61s (undef.) 7s (undef.) 65s (undef.) 9s (undef.) t rstl 480s (undef.) 48s 80s 720s 960s 68s 80s t pdh 15s 60s 2s 6s 15s 60s 1s 6.7s t pdl 60s 240s 8s 24s 60s 285s 7.3s 24s t w0l 60s 120s 6s 16s 60s 120s 7s 14s t sls , t spd 15s 60s 2s 6s 15s 60s 1.85s 7s


▲Up To Search▲   

 
Price & Availability of DS1961S-F3

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X